/*
*  Copyright 2019-2020 Zheng Jie
*
*  Licensed under the Apache License, Version 2.0 (the "License");
*  you may not use this file except in compliance with the License.
*  You may obtain a copy of the License at
*
*  http://www.apache.org/licenses/LICENSE-2.0
*
*  Unless required by applicable law or agreed to in writing, software
*  distributed under the License is distributed on an "AS IS" BASIS,
*  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*  See the License for the specific language governing permissions and
*  limitations under the License.
*/
package me.zhengjie.modules.app.device.domain;

import lombok.Data;
import cn.hutool.core.bean.BeanUtil;
import io.swagger.annotations.ApiModelProperty;
import cn.hutool.core.bean.copier.CopyOptions;
import javax.persistence.*;
import javax.validation.constraints.*;
import javax.persistence.Entity;
import javax.persistence.Table;
import org.hibernate.annotations.*;
import java.sql.Timestamp;
import java.time.LocalDateTime;
import java.io.Serializable;

/**
* @website https://el-admin.vip
* @description /
* @author Haojie Li
* @date 2021-03-01
**/
@Entity
@Data
@Table(name="app_setting_bind_info")
public class SettingBindInfo implements Serializable {

    @Id
    @Column(name = "id")
    @ApiModelProperty(value = "数据唯一标识")
    private String id;

    @Column(name = "server_address")
    @ApiModelProperty(value = "服务器地址")
    private String serverAddress;

    @Column(name = "hotel_no")
    @ApiModelProperty(value = "酒店编号")
    private String hotelNo;

    @Column(name = "hotel_room_number")
    @ApiModelProperty(value = "酒店房间编号")
    private String hotelRoomNumber;

    @Column(name = "resource_version")
    @ApiModelProperty(value = "资源版本号")
    private String resourceVersion;

    @Column(name = "local_ip")
    @ApiModelProperty(value = "本地IP地址")
    private String localIp;

    @Column(name = "device_type")
    @ApiModelProperty(value = "设备类型")
    private String deviceType;

    @Column(name = "storage_place")
    @ApiModelProperty(value = "存储位置")
    private String storagePlace;

    @Column(name = "bind_mac")
    @ApiModelProperty(value = "绑定的MAC地址")
    private String bindMac;

    @Column(name = "is_active")
    @ApiModelProperty(value = "激活状态【1、表示激活 0、表示未激活 -1、表示注销（删除）】")
    private Integer isActive;

    @Column(name = "create_by")
    @ApiModelProperty(value = "创建者")
    private String createBy;

    @Column(name = "update_by")
    @ApiModelProperty(value = "更新者")
    private String updateBy;

    @Column(name = "create_time")
    @CreationTimestamp
    @ApiModelProperty(value = "创建时间")
    private LocalDateTime createTime;

    @Column(name = "update_time")
    @UpdateTimestamp
    @ApiModelProperty(value = "更新时间")
    private LocalDateTime updateTime;


    public void copy(SettingBindInfo source){
        BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true));
    }
}
